package com.belizer.demo.list;

import java.util.Arrays;
import java.util.List;

public class Demo {
    public static void main(String[] args) {
        List<Integer> a = Arrays.asList(1,2,3,4,5,6,7,8,9,10);
        int asize = a.size();
        int subsize =3 ;

        int page = asize % subsize == 0 ? asize/subsize : asize/subsize + 1;
        for (int i = 1; i<=page; i++){
            List<Integer> subList = a.subList( (i-1) * subsize, i==page ? asize : i*subsize);
            System.out.println(subList);
        }
    }
}
